1. Field of the Invention
The present invention generally relates to a scanning apparatus and a method for obtaining the gray level of a scanned object therein, and more specifically by using at least three corrective elements provided inside the scanning apparatus with different light reflectivies in conjunction with interpolation method.
2. Description of the Related Art
In general, a scanning apparatus includes an image sensor comprised in an image sensor module. The image sensor has a plurality of pixel sensors to receive the light reflected from the scanned object and convert the received light into an analog electric signal representing the light reflectivity of the scanned object. Then an analog-to-digital(A/D) converter converts the analog electrical signal into a digital response representing the gray level of the scanned object for further processing.
Referring to FIG. 5, a conventional method for obtaining the gray level of a scanned object in a scanning apparatus is illustrated.
For a contact image sensor (CIS) scanner, the image sensor (CIS) is installed in a CIS module. To transform the received light into a corresponding gray level, first the analog electric signal generated by the CIS is converted into a digital response through a linear A/D converter, then a compensating firmware is used to fine tune the final gray level value. In the prior art, two corrective elements (white and dark) are used in the compensating firmware. FIG. 1 illustrates a conventional compensating firmware for converting the digital response generated by the image sensor module into a gray level representing the light reflectivity of the scanned object in a scanner of 8-bit resolution. In FIG. 1, the gray level of the white corrective element is defined as xe2x80x9c255xe2x80x9d and that of the dark corrective element is defined as xe2x80x9c0xe2x80x9d, thereby the range of the gray level of a scanned image is determined. When scanning an object, the CIS module first scans the white and dark corrective elements to obtain and store the values (I255, I0) of the digital responses generated by the CIS module (including a contact image sensor and a A/D converter) representing the light reflectivities of the two corrective elements respectively. Then, the CIS module scans an object, if the digital response corresponding to the light reflectivity of the scanned object is Ix, the corresponding gray level x of the scanned object can be determined according to the following equations:   "AutoLeftMatch"      "AutoLeftMatch"                                        x            =            0                                                              (                                                if                  ⁢                                      xe2x80x83                                    ⁢                                      I                    x                                                   less than                                   I                  0                                            )                        ;                                                                          x              =                                                                                          255                      -                      0                                                                                      I                        255                                            -                                              I                        0                                                                              xc3x97                                      (                                                                  I                        x                                            -                                              I                        0                                                              )                                                  +                0                                      ⁢                          xe2x80x83                                                                          (                                                if                  ⁢                                      xe2x80x83                                    ⁢                                      I                    0                                                  ≤                                  I                  x                                ≤                                  I                  255                                            )                        ;                                                            x            =            255                                                              (                                                if                  ⁢                                      xe2x80x83                                    ⁢                                      I                    x                                                   greater than                                   I                  255                                            )                        .                              
In accordance with the conventional art, if the image sensor can convert the light reflectivity of the scanned object into an analog electric signal in a linear way, such converting method will be accurate. However, due to the non-linear transfer curve of CIS, CIS can not convert the light reflectivity into an analog electric signal in a linear way.
FIG. 2 illustrates the transfer curve in the firmware of a conventional scanning apparatus with 8-bit resolution. The combination transfer curve for a xe2x80x9cnon-linear CIS sensorxe2x80x9d with a xe2x80x9clinear A/D converterxe2x80x9d under a fixed exposure time is shown as curve a. As the conventional firmware transfer curve, the two corrective elements define a linear segment b. Apparently, the digital response generated by the curve a could not be accurately compensated by the straight line b.
Please refer to FIG. 2, assume the actual gray level of the scanned object is X1, an digital response Ix will be generated through the transfer curve a. According to the conventional firmware defined by only white and dark corrective elements (straight line b), based on the digital response Ix, the converted gray level would be X2. The difference between X2 and X1 will degrade the scanning quality and thus affect the performance of the CIS scanner.
Therefore, an object of the present invention is to provide a method for a scanning apparatus to compensate the non-linearity between the analog electric signal generated by the image sensor and the actual gray level of the scanned object. A scanning apparatus for implementing such method will also be disclosed.
One embodiment of the present invention comprises the steps of: providing three corrective elements, wherein each of the corrective elements has a different light reflectivity, and the corresponding gray levels of the three corrective elements are pre-defined and pre-stored in the scanning apparatus; scanning each of the corrective elements to obtain three corresponding values of the digital responses generated by the CIS module; scanning an object to obtain the digital response generated by the CIS module; comparing the digital response value of the scanned object with the digital response values of each of the corrective elements to determine two corrective elements whose digital response values are closest to the digital response value of the scanned object; and, using the digital response values of the two determined corrective elements and their corresponding gray levels in conjunction with the interpolation method to determine the corresponding gray level of the scanned object.
Operating in conjunction with the method described above, a scanning apparatus for scanning an object is also disclosed. The scanning apparatus at least comprises: an image sensor module; at least three corrective elements; and a processing unit.
The image sensor module, for example is a contact image sensor, comprises a contact image sensor (CIS) and an anlog-to-digital converter (A/D converter) The CIS receives a light reflected from the scanned object and generates an analog electric signal representing the light reflectivity of the object. The A/D converter converts the analog electric signal into a digital response.
The three corrective elements have different light reflectivity, whose corresponding gray levels are pre-defined and pre-stored in the scanning apparatus. Moreover, the corrective elements are scanned by the image sensor module during a scanning process, thereby the light reflectivities of each of the corrective elements are obtained.
The processing unit will then convert the light reflectivity of the object into a corresponding gray level of the object according to the light reflectivities of each of the corrective elements.
According to one embodiment, the image sensor module has a non-linear transfer curve to convert the received light into a digital response. The transfer curve has a first deviated node and a second deviated node. The method comprises the steps of:
(1)obtaining the minimum digital response generated by the image sensor module by blocking all light from being received by the image sensor module, the corresponding gray level of the minimum digital response being defined as the minimum gray level xe2x80x9c0xe2x80x9d;
(2)providing a first corrective element whose gray level being defined as the maximum gray level, and a first digital response being generated by said image sensor module when the first corrective element is scanned;
(3)providing a second corrective element whose gray level being corresponding to the first deviated node of the transfer curve, and the second digital response being generated by the image sensor module when the second corrective element is scanned;
(4)providing a third corrective element whose gray level being corresponding to the second deviated node of the transfer curve, and the third digital response being generated by the image sensor module when scanning the third corrective element;
(5)scanning the object to obtain the object digital response generated by the image sensor module;
(6)selecting two digital responses from the first, second, third, and minimum digital responses, wherein the values of the two selected digital responses are closer to the object digital response; and
(7)using the object digital response, two selected digital response, and the gray levels corresponding to the selected digital responses in conjunction with the linear interpolation method to determine the corresponding gray levels of said object.
Further features and advantages of the present invention, as well as the structure and operation of various embodiments of the present invention, are described in details below with respect to the accompanying drawings. In the drawings, same reference numbers indicate identical or functionally similar elements.